# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: tikysal <tikysal@gmail.com>
# Derived from Daniel Ehlers'

pkgname=coin-or-coinutils
pkgver=2.11.9
pkgrel=1
pkgdesc='COIN-OR collection of utility classes'
arch=(loong64 x86_64)
url='https://github.com/coin-or/CoinUtils'
license=(EPL)
depends=(zlib bzip2 glpk lapack coin-or-data-sample)
makedepends=(gcc-fortran doxygen)
groups=(coin-or)
source=($pkgname-$pkgver.tar.gz::https://github.com/coin-or/CoinUtils/archive/refs/tags/releases/$pkgver.tar.gz)
sha256sums=('15d572ace4cd3b7c8ce117081b65a2bd5b5a4ebaba54fadc99c7a244160f88b8')

build() {
  cd CoinUtils-releases-$pkgver

  ./configure --prefix=/usr --with-blas-lib='-lblas' --with-lapack-lib='-llapack' --with-glpk-lib='-lglpk' --enable-dependency-linking
  make
}

check() {
  cd CoinUtils-releases-$pkgver
  make test
}

package() {
  cd CoinUtils-releases-$pkgver
  make DESTDIR="$pkgdir" install
}
